package it.antonio.leaves.util;


public class Probe {

	public final static long SECONDS = 1000000000;
	public final static long MILLI_SECONDS = 1000000;
	public final static long NANO_SECONDS = 1000;

	private long startTime = System.nanoTime();
	
	private Probe() {
		startTime = System.nanoTime();
	}
	
	public static Probe start(){
		return new Probe();
	}
	
	public void reset() {
		startTime = System.nanoTime();
	}

	public long getTimeElapsed() {
		return (System.nanoTime() - startTime)/ MILLI_SECONDS;
	}

	public long getTimeElapsed(long precision) {
		return (System.nanoTime() - startTime)/ precision;
	}
}